package work20241202_chap5oop.a_oop;

/**
 * @author zdl
 * @date 2024/12/2
 */
class ClassA{
    int value = 10;
}
public class Demo4{
    public static void main(String args[]){
        ClassA ca = new ClassA();
        ca = getObject();
        ca = getObject();
        ca = getObject();
        System.out.println(ca.value); //20
    }
    public static ClassA getObject(){
        ClassA newObject = new ClassA();
        newObject.value += 10;
        return newObject;
    } }
